<?php 
/*
# ------------------------------------------------------------------------
# JA Job Board Package
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/

	$field_name = JRequest::getVar('field_name');
	$field_type = JRequest::getVar('field_type')=='FILE'?'allowed_ext':'allowed_img';
	setcookie('number_element',0);
?>
<div class="frm-uploadform">
<div id="error_msg" style="display:none"></div>
<div id="success_msg"  style="display:none"></div>
<table class="tbl-uploadform">
	<tr>
		<td style="font-style:italic;">
			<?php echo JText::_('Upload file'); ?>
		</td>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td width="50%" valign="top">
			<form id="uploadfile" name="uploadfile" action="<?php echo JURI::root();?>index.php" method="POST" enctype="multipart/form-data" target="upload_target">
			
				 <input onchange="$('uploadfile').submit()" type="file" name="<?php echo $field_name; ?>" id="<?php echo $field_name ?>" value="" />
				 
				 <!--<input type="submit" name="upload_file" value="<?php echo JText::_('Upload File'); ?>" />-->
				 
				 <input type="hidden" name="option" value="com_jajobboard" />
				 <input type="hidden" name="view" value="jajobs" />
				 <input type="hidden" name="layout" value="jauploadfilepath" />
				 <input type="hidden" name="field_name" value="<?php echo $field_name; ?>" />
				 <input type="hidden" name="field_type" value="<?php echo $field_type; ?>" />
				 <input type="hidden" name="tmpl" value="component" />
				 <input type="hidden" value="" id="upload_file_path" name="upload_file_path" />
			</form>
		</td>
		<td width="50%">
			<ul id="file_list"></ul>
		</td>
	</tr>
</table>

<input type="button" class="button" value="<?php echo JText::_('Finish') ?>" onclick="window.parent.update_attachment($('upload_file_path').value,'<?php echo JRequest::getVar('field_name'); ?>','<?php echo JRequest::getVar('job_id'); ?>')" />
<iframe id="upload_target" name="upload_target" src="#" style="width:0;height:0;border:0px solid #fff;" ></iframe> 
</div>